<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改供应商')" />
    <th:block th:include="include :: select2-css" />

</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-supplier-edit" th:object="${constractSupplier}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">供应商名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" required>营业执照号码：</label>
                <div class="col-sm-8">
                    <input name="bizLicenseNum" th:field="*{bizLicenseNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">跟踪单位：</label>
                <div class="col-sm-8">
                    <select name="apartment" class="form-control m-b" th:with="type=${@dict.getType('sys_supplier_apartment')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{apartment}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <input name="contact" th:field="*{contact}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否合格：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'isQualified_' + dict.dictCode}" name="isQualified" th:value="${dict.dictValue}" th:field="*{isQualified}" required>
                        <label th:for="${'isQualified_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应商来源：</label>
                <div class="col-sm-8">
                    <input name="source" th:field="*{source}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应商等级：</label>
                <div class="col-sm-8">
                    <select name="grade" class="form-control m-b" th:with="type=${@dict.getType('sys_supplier_grade')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{grade}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应商分类：</label>
                <div class="col-sm-8">
                    <select name="cate" class="form-control m-b" th:with="type=${@dict.getType('sys_supplier_cate')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{cate}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供应商资质证书等级：</label>
                <div class="col-sm-8">
                    <select name="certificateGrade" class="form-control m-b" th:with="type=${@dict.getType('sys_cir_grade')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{certificateGrade}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分包专业：</label>
                <div class="col-sm-8">
                    <select name="subcontract" class="form-control m-b" th:with="type=${@dict.getType('sys_supplier_fenbao')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{subcontract}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开户行：</label>
                <div class="col-sm-8">
                    <input name="bank" th:field="*{bank}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收款账号：</label>
                <div class="col-sm-8">
                    <input name="account" th:field="*{account}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />

    <script th:inline="javascript">
        var prefix = ctx + "system/supplier";
        $("#form-supplier-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-supplier-edit').serialize());
            }
        }
    </script>
</body>
</html>